<?php

namespace backend\models;

use Yii;

/**
 * This is the model class for table "project_single".
 *
 * @property int $id
 * @property int $project_id
 * @property string $project_tag 标签
 * @property string $detail 项目介绍
 * @property string $asset 涉及资产情况
 * @property string $price_pre_evaluate 评估总价
 * @property string $evaluate_by 评估依据
 * @property string $price 转让价格
 * @property int $is_important 是否重点推荐
 */
class ProjectSingleDjr extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'project_single';
    }

    /**
     * @return \yii\db\Connection the database connection used by this AR class.
     */
    public static function getDb()
    {
        return Yii::$app->get('forge');
    }

    public function attributes()
    {
        return array_merge(parent::attributes(), ['project_tag_real', 'project_tag_personal', 'project_tag_intangible', 'project_tag_creditor']);
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['project_id', 'is_important'], 'integer'],
            [['detail', 'asset', 'evaluate_by'], 'string'],
            [['price_pre_evaluate', 'price'], 'number'],
            [['project_tag', 'project_tag_real', 'project_tag_personal', 'project_tag_intangible', 'project_tag_creditor'], 'safe'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'project_id' => 'Project ID',
            'project_tag' => '标签',
            'detail' => '项目介绍',
            'asset' => '涉及资产情况',
            'price_pre_evaluate' => '评估总价',
            'evaluate_by' => '评估依据',
            'price' => '转让价格',
            'is_important' => '是否重点推荐',
        ];
    }

    /**
     * @inheritdoc
     * @return ProjectSingleDjrQuery the active query used by this AR class.
     */
    public static function find()
    {
        return new ProjectSingleDjrQuery(get_called_class());
    }
}
